package com.yue.springDemo.commons.logger;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 日志处理
 */
@Component
public class MyLoggerFactory {

    /**
     * log
     */
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    /**
     * 信息日志
     *
     * @param msg 消息
     */
    public void info(String msg) {
        logger.info(msg);
    }

    /**
     * 错误日志
     *
     * @param e 异常
     */
    public void error(Throwable e) {
        logger.error("系统异常", e);
    }

    /**
     * 错误日志
     *
     * @param msg 消息
     */
    public void error(String msg) {
        logger.error(msg);
    }

}
